/**
 * <p>Title: MaterialBatch</p>
 * <p>Description: The Entity of MaterialBatch</p>
 * <p>Copyright: Shanghai Batchsight Pharmaceutical Technologies, Inc. Copyright(c) 2016</p>
 * @author Wan Shuaishuai
 * @version 1.0
 * <pre>Histroy:
 *       2016-11-21  Wan Shuaishuai  Create
 *</pre>
*/
package cn.jhg.account.entity;

import java.io.Serializable;
import java.sql.Timestamp;

import org.bson.Document;
import org.bson.types.Binary;
import org.bson.types.ObjectId;

public class MaterialBatch implements Serializable{

	//对应t_ibcp_material_batch 表中字段
	private int id=0; //批次Id
	private int codeId=0; //编码id
	private String batchNo=null; //批次号
	private int manuId=0; //生产厂Id
	private int statId=0; // 状态代码
	private String propId=null; //属性 id
	private Timestamp expDate=null; //有效期
	private Timestamp inspDate=null; //复检期
	
	//对应t_ibcp_material_supplier 表中字段
	private String manuName=null; //生产厂名称
	
	//对应 mongodb 中属性
	/*private String value; //属性值
	private String type; //属性类型
	private String desc; //描述
	private String uom; //单位
	private String cate; //物料分类
*/	
	private Document property=null;
	
	public String getManuName() {
		return manuName;
	}
	public void setManuName(String manuName) {
		this.manuName = manuName;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getCodeId() {
		return codeId;
	}
	public void setCodeId(int codeId) {
		this.codeId = codeId;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public int getManuId() {
		return manuId;
	}
	public void setManuId(int manuId) {
		this.manuId = manuId;
	}
	public int getStatId() {
		return statId;
	}
	public void setStatId(int statId) {
		this.statId = statId;
	}
	public Timestamp getExpDate() {
		return expDate;
	}
	public void setExpDate(Timestamp expDate) {
		this.expDate = expDate;
	}
	public Timestamp getInspDate() {
		return inspDate;
	}
	public void setInspDate(Timestamp inspDate) {
		this.inspDate = inspDate;
	}
	
	public String getPropId() {
		return propId;
	}
	public void setPropId(String propId) {
		this.propId = propId;
	}
	
	public Document getProperty() {
		return property;
	}
	public void setProperty(Document property) {
		this.property = property;
	}
	@Override
	public String toString() {
		return "MaterialBatch [id=" + id + ", codeId=" + codeId + ", batchNo=" + batchNo + ", manuId=" + manuId
				+ ", statId=" + statId + ", propId=" + propId + ", expDate=" + expDate + ", inspDate=" + inspDate
				+ ", manuName=" + manuName + ", property=" + property + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((batchNo == null) ? 0 : batchNo.hashCode());
		result = prime * result + codeId;
		result = prime * result + ((expDate == null) ? 0 : expDate.hashCode());
		result = prime * result + id;
		result = prime * result + ((inspDate == null) ? 0 : inspDate.hashCode());
		result = prime * result + manuId;
		result = prime * result + ((manuName == null) ? 0 : manuName.hashCode());
		result = prime * result + ((propId == null) ? 0 : propId.hashCode());
		result = prime * result + ((property == null) ? 0 : property.hashCode());
		result = prime * result + statId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MaterialBatch other = (MaterialBatch) obj;
		if (batchNo == null) {
			if (other.batchNo != null)
				return false;
		} else if (!batchNo.equals(other.batchNo))
			return false;
		if (codeId != other.codeId)
			return false;
		if (expDate == null) {
			if (other.expDate != null)
				return false;
		} else if (!expDate.equals(other.expDate))
			return false;
		if (id != other.id)
			return false;
		if (inspDate == null) {
			if (other.inspDate != null)
				return false;
		} else if (!inspDate.equals(other.inspDate))
			return false;
		if (manuId != other.manuId)
			return false;
		if (manuName == null) {
			if (other.manuName != null)
				return false;
		} else if (!manuName.equals(other.manuName))
			return false;
		if (propId == null) {
			if (other.propId != null)
				return false;
		} else if (!propId.equals(other.propId))
			return false;
		if (property == null) {
			if (other.property != null)
				return false;
		} else if (!property.equals(other.property))
			return false;
		if (statId != other.statId)
			return false;
		return true;
	}

}
